<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <div>
      <img
        src="https://tesseract.projectnaptha.com/img/eng_bw.png"
        alt=""
        srcset=""
        width="800"
        height="600"
      />
    </div>
    <script src="https://cdn.jsdelivr.net/npm/tesseract.js@5/dist/tesseract.min.js"></script>
    <script>
      async function load() {
        let createWorker = Tesseract.createWorker;
        const worker = await createWorker("eng+chi_sim"); // 英文+中文 模式
        const ret = await worker.recognize(
          // "./message.jpg"
          "https://tesseract.projectnaptha.com/img/eng_bw.png"
        );
        console.log(ret.data.text);
        await worker.terminate();
      }

      load();
    </script>
  </body>
</html>
